<?php
/**
 * 
 * Modelo de MAIL_DetallesCI
 * @author natanael
 * 
 */
class MailDetallesCi extends Model
{
     
	 private $_nameTable = "MAIL_DetallesCI";
	
     public function __construct()
     {
         parent::Model();
         $this->load->database();
     }
     
     public function loadRegistro($where)
     {
		    $result = $this->db->get_where($this->_nameTable, $where);
	
		    return $this->GetArrayFromQueryResult($result);
			
     }
     
     private function GetArrayFromQueryResult($result) 
	 {
			if ($result->num_rows() == 0)
				return false;
	
			$objeto_arr = array();
	
			foreach ($result->result() as $record) {
				$objeto_arr[] = new MMailDetallesCi($record);
			}
	
			return $objeto_arr;
      }
      
      public function addRegistro($data)
      {
         if ($this->db->insert($this->_nameTable,$data)){
           	return true;
           }
           
            return false;
      }
     
}

class MMailDetallesCi
{
     private $_idHether;
     private $_referencia;
     private $_telefono;
     private $_contacto;
     private $_etapa;
     private $_mail; 
     
     public function __construct($ojt)
     {
          $this->setIdHether($ojt->IdHether);
          $this->setReferencia($ojt->Referencia);
          $this->setTelefono($ojt->Telefono);
          $this->setContacto($ojt->Contacto);
          $this->setEtapa($ojt->Etapa);
          $this->setMail($ojt->Mail);
     }
     
     public function getIdHether()
     {
        return $this->_idHether;
     }
     
     public function setIdHether($ojt)
     {
        $this->_idHether = $ojt;
     }
     
     public function getReferencia()
     {
        return $this->_referencia;
     }
     
     public function setReferencia($ojt)
     {
        $this->_referencia = $ojt;
     }
     
     public function getTelefono()
     {
        return $this->_telefono;
     }
     
     public function setTelefono($ojt)
     {
        $this->_telefono = $ojt;
     }
     
     public function getContacto()
     {
        return $this->_contacto;
     }
     
     public function setContacto($ojt)
     {
        $this->_contacto = $ojt;
     }
     
     public function getEtapa()
     {
        return $this->_etapa;
     }
     
     public function setEtapa($ojt)
     {
        $this->_etapa = $ojt;
     }
     
     public function getMail()
     {
        return $this->_mail;
     }
     
     public function setMail($ojt)
     {
        $this->_mail = $ojt;
     }
}